bn.fit
, bn.fit.dnode
, bn.fit.gnode
or
bn.fit.onode
.## methods available for "bn.fit"
## S3 method for class 'bn.fit':
fitted(object, ...)
## S3 method for class 'bn.fit':
coef(object, ...)
## S3 method for class 'bn.fit':
residuals(object, ...)
## S3 method for class 'bn.fit':
predict(object, node, data, ..., debug = FALSE)
## S3 method for class 'bn.fit':
logLik(object, data, ...)
## S3 method for class 'bn.fit':
AIC(object, data, ..., k = 1)
## S3 method for class 'bn.fit':
BIC(object, data, ...)## methods available for "bn.fit.dnode"
## S3 method for class 'bn.fit.dnode':
coef(object, ...)
## S3 method for class 'bn.fit.dnode':
predict(object, data, ..., debug = FALSE)
## methods available for "bn.fit.onode"
## S3 method for class 'bn.fit.onode':
coef(object, ...)
## S3 method for class 'bn.fit.onode':
predict(object, data, ..., debug = FALSE)
## methods available for "bn.fit.gnode"
## S3 method for class 'bn.fit.gnode':
fitted(object, ...)
## S3 method for class 'bn.fit.gnode':
coef(object, ...)
## S3 method for class 'bn.fit.gnode':
residuals(object, ...)
## S3 method for class 'bn.fit.gnode':
predict(object, data, ..., debug = FALSE)
bn.fit
, bn.fit.dnode
or bn.fit.gnode
.k = 1
gives the expression used to compute AIC.TRUE
a lot of debugging output
is printed; otherwise the function is completely silent.predict
returns a numeric vector (for Gaussian networks) or a factor
(for discrete networks). All the other functions return a list with an element for each node in
the network (if object
has class bn.fit
) or a numeric
vector (if object
has class bn.fit.dnode
or bn.fit.gnode
).
coef
(and its alias coefficients
) extracts model
coefficients (which are conditional probabilities in discrete
networks and linear regression coefficients in Gaussian networks). residuals
(and its alias resid
) extracts model
residuals and fitted
(and its alias fitted.values
)
extracts fitted values from fitted Gaussian networks.
If the bn.fit
object does not include the residuals or the
fitted values (for the nodes of interest, in the case of
bn.fit.gnode
objects), both functions return NULL
.
predict
returns the predicted values for node
for
the data specified by data
.
bn.fit
, bn.fit-class
.data(gaussian.test)
res = hc(gaussian.test)
fitted = bn.fit(res, gaussian.test)
coefficients(fitted)
coefficients(fitted$C)
str(residuals(fitted))
data(learning.test)
res2 = hc(learning.test)
fitted2 = bn.fit(res2, learning.test)
coefficients(fitted2$E)
Run the code above in your browser using DataLab